#ifndef __DDChargeAnalysis__
#define __DDChargeAnalysis__

#include "DDVAnalysis.hh"

using namespace std;

class DDChargeAnalysis : public DDVAnalysis {
public:
  int Analyze(DDVData * data);

private:
  void minmax(DDVData* data, int channel, int trace, float* min_num_electrons, float* max_num_electrons, float* total_num_electrons);
  void create_histo(DDVData* data, int channel, float* min_num_electrons, float* max_num_electrons, float* total_num_electrons);
  void charge_histo(DDVData* data, int channel);

/*
  void noise_minmax();
  void noise_range();
  void noise_histo();
  void write_noise_histo();

  void variance_minmax();
  void variance_range();
  void variance_histo();
  void write_variance_histo();

  bool variance_cut(bool first_loop);
  void write_variance_cut();

  bool count_peaks(bool first_loop_peakcount);
  void write_count_peaks();

  void WriteRootfile();
  void PlantTree();
*/
/*

  //----charge_histo----//
  float charge;
  float num_electrons;
  float min_num_electrons;
  float max_num_electrons;
  float total_num_electrons;
  float mean_num_electrons;
  bool* all_electrons_cut;
  int num_neg;
  bool first_trace_charge;
  float num_electrons_threshold;
  int num_electrons_outside;
  TH1F* trace_electrons;
  //--------------------//

  //-----noise_histo----//
  bool first_sample_noise;
  float voltage;
  float max_v_noise;
  float min_v_noise;
  float total_v_noise;
  float mean_v_noise;
  int num_over;
  //--------------------//

  //---variance_histo---//
  bool first_trace_variance;
  float v_total;
  float v_mean;
  float v_diff_total;
  float sigma_squared;
  float sigma;
  float max_sigma;
  float min_sigma;
  float total_sigma;
  float mean_sigma;
  TH1F* variance;
  //--------------------//

  //----count_peaks-----//
  int num_peaks;
  int num_non_empty;
  //--------------------//

  //----general_use-----//
  float voltage_threshold;
  float variance_threshold;
  float time_per_div;
  int num_bins;
  int num_traces;
  int num_traces_cut;
  RawData* my_data;
  TH1F* voltage_noise;
  TH1F* my_waveform;
*/

};


#endif
